package com.feicheng.common.config;

import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

@Configuration
@Slf4j
public class ShopAdminInterceptorConfig implements WebMvcConfigurer {
    @Autowired
    ShopAdminInterceptor shopAdminInterceptor;

    @Override
    public void addInterceptors(InterceptorRegistry registry) {

        registry.addInterceptor(shopAdminInterceptor).addPathPatterns("/shop/admin/**")
                .excludePathPatterns(
                        "/shop/admin/system/login/**",
                        "/shop/admin/store/new/**",
                        "/shop/admin/store/old/**");
    }
}
